/*
export function someMutation (state) {
}
*/

import { LocalStorage } from 'quasar'
import setAxiosHeaders from './helpers'

export const LOGIN = (statue, user) => {
  statue.user = user
  LocalStorage.set('user', user)
  setAxiosHeaders(statue)
}

export const LOGOUT = (statue) => {
  statue.user = null
  LocalStorage.clear()
  setAxiosHeaders(statue)
}

export const UPDATE_CSRF_TOKEN = (state, token) => {
  // 现在我们要将token添加到请求头上面
  state.csrf_token = token
  setAxiosHeaders(state)
}
